package javango.forms.fields.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Map;

import javango.forms.widgets.AbstractWidget;
import javango.forms.widgets.Widget;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface FieldProperties
{
	/** 
	 * Just here so widgetClass below has a default that can be ignored.
	 * 
	 * @author johns
	 *
	 */
	public class NoWidget extends AbstractWidget {

		@Override
		public String render(String name, Object value,
				Map<String, Object> attrs) {
			return null;
		}

		public NoWidget(Map<String, Object> attrs) {
			super(attrs);
		}
		
	}
	boolean required() default true;
	boolean editable() default true;
	boolean allowNull() default false;
	boolean hidden() default false;
	String verboseName() default "";
	String helpText() default "";
	Class<? extends Widget> widgetClass() default NoWidget.class;
	
}
